<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>我报告的漏洞 | <?php echo ($site_name_cn); ?>安全应急响应中心</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
        <meta name="description" content="<?php echo ($site_name_cn); ?>安全应急响应中心,<?php echo ($site_name_en); ?> Security Response Center">
        <meta name="keywords" content="<?php echo ($site_name_cn); ?>,<?php echo ($site_name_en); ?>,安全团队,应急响应,<?php echo ($site_name_cn); ?>安全应急响应中心,<?php echo ($site_name_en); ?> Security Response Center">
        <meta name="renderer" content="webkit">
        <meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no">
        <link rel="icon" href="/Public/Index/images/logo.ico">
        <link rel="stylesheet" href="/Public/Index/css/main.css">
        <!--[if (gte IE 6)&(lte IE 8)]>
        兼容 CSS3 选择器
        <script type="text/javascript" src="/Public/Index/js/selectivizr.min.js"></script>
        兼容 media query
        <script type="text/javascript" src="/Public/Index/js/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="header">
            <div>
                <div class="logo">
                    <a href="">
                        <div class="logo_pic">
                        </div>
                        <div class="logo_name">
							<p><?php echo ($site_name_cn); ?>安全应急响应中心</p>
                            <p><?php echo ($site_name_en); ?> Security Response Center</p>
                        </div>
                    </a>
                </div>

                <div class="userpanel">
                    <div class="userpanel_line">
                        <div></div>
                    </div>
                    <div class="userpanel_user">
                        <img class="user_avatar mod-avatar-30" src="/Public/Uploads/<?php echo session('avatar');?>" alt="">
                        <span class="user_username"><?php echo session('username'); if(session('mnum') == 0): else: ?><i class="i-header-message"><?php echo session('mnum');?></i><?php endif; ?></span>
                        <i class="user_arrow"></i>
                        <div class="user_menu">
                            <ul class="menu_list">
                                <li class="list_item list_item-user">
                                    <a href="<?php echo U('index/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">个人主页</span>
                                    </a>
                                </li>
                                <li class="list_item list_item-message">
                                    <a href="<?php echo U('message/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">消息中心</span>
                                        <i class="item_icon-message"><?php echo session('mnum');?></i>
                                    </a>
                                </li>
                                <li class="list_item list_item-account">
                                    <a href="<?php echo U('info/index');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">账户设置</span>
                                    </a>
                                </li>
                                <li class="list_item list_item-logout">
                                    <a href="<?php echo U('login/logout');?>">
                                        <i class="item_icon"></i>
                                        <span class="item_text">注销</span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="nav">
                    <ul>
                        <li class="[index_banner]"><a href="/index.php">首页</a></li>
                        <li class="[banner_selected]"><a href="<?php echo U('post/add');?>">提交漏洞</a></li>
                        <li class="[annoucment_banner]"><a href="/index.php?m=&c=page&a=index">公告</a></li>
						<li class="[blog_banner]"><a href="/index.php?m=&c=blog&a=index">博客</a></li>
						<li class="[hall_banner]"><a href="/index.php?m=&c=hall&a=index">贡献榜</a></li>
                        <li class="[gift_banner]"><a href="<?php echo U('gift/index');?>">礼品兑换</a></li>
                    </ul>
                </div>
            </div>
        </div>
<div class="container container-user container-user-report">
            <div>
                <!-- section-subnav 标题-->
                <div class="section section-subnav">
                    <div class="section_subnav">
                        <p class="subnav_title"><a href="user-center.html">个人中心</a></p>
                    </div>
                </div>

                <div class="section section-user">
                    <div class="section_user">
                        <div class="user_sidebar">
                            <div class="sidebar_header">
                                <!-- <p>个人中心</p> -->
                            </div>
                            <ul class="sidebar_nav">
                                <li class="nav_item"><a href="<?php echo U('index/index');?>">我的个人中心</a></li>
                                <li class="nav_item"><a href="<?php echo U('gift/record');?>">我的安全币</a></li>
                                <li class="nav_item nav_item-active"><a href="<?php echo U('post/index');?>">我报告的漏洞</a></li>
                                <li class="nav_item"><a href="<?php echo U('gift/order');?>">我的礼品</a></li>
                                <li class="nav_item"><a href="<?php echo U('message/index');?>">消息中心</a></li>
                                <li class="nav_item"><a href="<?php echo U('info/index');?>">我的个人信息</a></li>
                            </ul>
                        </div>

                        <div class="user_body">
                            <div class="body_header">
                                <div class="header_report">
                                    <div class="report_pic"><i></i></div>
                                    <div class="report_info-1">
                                        <p class="info-1_report">
											<br/>
                                            <span class="report_text">我发现的漏洞</span>
                                            <span class="report_bug"><span class="bug_num"><?php echo ($post_num); ?></span>个</span>
                                        </p>
                                    </div>
                                </div>
                            </div>
                            <div class="body_content">
                                <div class="mod-sheet">
                                    <div class="sheet_header">
                                        <p class="header_title">漏洞记录</p>
                                        <div class="header_sift">

                                            <div class="mod-form-search">
                                                <input id="post_title" class="form-search_input" type="text" placeholder="搜索名称">
                                                <input class="form-search_submit" type="submit" onclick="search_my_post();" value="">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="sheet_body">
                                        <table class="body_table">
                                            <thead>
												<tr>
													<th class="th-1">提交时间</th>
													<th class="th-2">漏洞名称</th>
													<th class="th-3">当前状态</th>
													<th class="th-4">危害等级</th>
												</tr>
                                            </thead>
                                            <tbody id="post_content">
												<?php if(is_array($model)): foreach($model as $key=>$v): ?><tr>
														<td><?php echo (date("Y/m/d",$v["time"])); ?></td>
														<td><a href="<?php echo U('post/view?rid='); echo ($v["id"]); ?>"><?php echo ($v["title"]); ?></a></td>
														<?php if($v["type"] == 1): ?><td class="colortips-black">审核中</td>
														<?php elseif($v["type"] == 2): ?><td class="colortips-gray">已忽略</td>
														<?php elseif($v["type"] == 3): ?><td class="colortips-blue">已确认</td>
														<?php elseif($v["type"] == 4): ?><td class="colortips-green">已修复</td>
														<?php elseif($v["type"] == 5): ?><td class="colortips-green">已完成</td><?php endif; ?>
														<?php if($v["rank"] == 1): ?><td class="colortips-gray">无影响</td>
														<?php elseif($v["rank"] == 2): ?><td class="colortips-black">低危</td>
														<?php elseif($v["rank"] == 3): ?><td class="colortips-orange">中危</td>
														<?php elseif($v["rank"] == 4): ?><td class="colortips-red">高危</td><?php endif; ?>
													</tr><?php endforeach; endif; ?>
                                            </tbody>
                                        </table>
                                    </div>

                                    <div class="mod-pageflip">
                                        <ul>
                                           <?php echo ($page); ?>
                                        </ul>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
</div>
<script>
function search_my_post(){
							var  post_title_val = $("#post_title").val();
							$.ajax({
								url: "/user.php?m=user&c=post&a=search",
								type: "POST",
								data: {title:post_title_val},
								success: function (data) {
									if (data.status == "1") {
										$("#post_content").empty();
										$.each(data.result,function(i,item){
											var report_time = beautify_time(item['time']); 
											if(item['rank']==1){
												var report_rank = '无影响';
												var report_rank_color = 'colortips-gray';
											} else if (item['rank']==2){
												var report_rank = '低危';
												var report_rank_color = 'colortips-black';
											} else if (item['rank']==3){
												var report_rank = '中危';
												var report_rank_color = 'colortips-orange';
											} else if (item['rank']==4){
												var report_rank = '高危';
												var report_rank_color = 'colortips-red';
											} else {
												var report_rank = '无影响';
												var report_rank_color = 'colortips-gray';
											}
											if(item['type']==1){
												var report_stage = '审核中';
												var report_stage_color='colortips-black';
											} else if (item['type']==2){
												var report_stage = '已忽略';
												var report_stage_color='colortips-gray';
											} else if (item['type']==3){
												var report_stage = '已确认';
												var report_stage_color='colortips-blue';
											} else if (item['type']==4){
												var report_stage = '已修复';
												var report_stage_color='colortips-green';
											} else if (item['type']==5){
												var report_stage = '已完成';
												var report_stage_color='colortips-green';
											}else {
												var report_stage = '审核中';
												var report_stage_color='colortips-black';
											}
											$("#post_content").append("<tr><td>"+ report_time +"</td><td><a href=\"/xsrc/user.php?m=user&amp;c=post&amp;a=view&amp;rid="+ item['id'] +"\">"+ item['title'] +"</a></td><td class=\""+report_stage_color+"\">"+ report_stage +"</td><td class=\""+report_rank_color+"\">"+report_rank+"</td></tr>");
										});
									}else{
										$("#post_content").empty();
									}
								},
								error: function () {
									$("#post_content").empty();
								}
							});
}

function beautify_time(time){
    timestamp = parseInt(time + '000');
	var newDate = new Date(timestamp);
	var y = newDate.getFullYear();
	var m = newDate.getMonth() + 1;
	var d = newDate.getDate();
	var after_time = y + '/' + m + '/' + d;
	return after_time;
}

</script>
<!-- footer -->
        <div class="footer">
            <div>
                <div class="footer_about">
                    <p class="about_link">
                        <a href="<?php echo ($site_about); ?>" target="_blank">关于腾讯</a>
                        |
                        <a href="<?php echo ($site_career); ?>">加入我们</a>
                        |
                        <a href="/user.php?m=user&c=post&a=add">报告漏洞</a>
                    </p>
                    <p class="about_copyright">
                        <span>Copyright &copy; <?php echo date('Y'); ?> <?php echo ($site_copyright); ?>. All Rights Reserved</span>
						<span>Powered by <a href="https://security.tencent.com/index.php/xsrc">Tencent xSRC</a></span>
                    </p>
                </div>

                <div class="footer_contact">
                    <a class="contact_icon-email" href="mailto:<?php echo ($site_email); ?>"><i></i><span>专用邮箱</span>|</a>
                    <a class="contact_icon-weixin mod-qrcode" href="">
                        <i></i><span>微信公众号</span>
                        <div class="qrcode">
                            <div class="qrcode_pic">
                                <img src="<?php echo ($site_wechat); ?>" alt="">
                            </div>
                            <span class="qrcode_text">扫一扫关注公众号</span>
                        </div>
                    </a>
                </div>
            </div>
        </div>

        <script src="/Public/Index/js/jquery-1.7.2.min.js"></script>
        <script src="/Public/Index/js/test.js"></script>
		<script src="https://security.tencent.com/static/plugins/jquery.ajaxfileupload.js"></script>
    </body>
</html>